package problems;

import junit.framework.TestCase;

public abstract class AbstractEuler extends TestCase {
	public abstract Number calculate();
	protected abstract Number getCorrectAnswer(); 
	public void testAnswerCorrect() {
		Object answer = calculate();
		String answerString = "calculated answer for " + getClass().getSimpleName() + ": " + answer;
		if (answer == null) {
			System.err.println(answerString);
			fail("answer has not yet been filled");
		} else {
//			System.out.println(answerString);
		}
		assertEquals(getCorrectAnswer(), answer);
	}
}
